﻿using System;
using fastCSharp;
using fastCSharp.code.cSharp;

namespace diantou.dataModel.path
{
    /// <summary>
    /// 企业考试
    /// </summary>
    public struct exam
    {
        /// <summary>
        /// 企业考试标识
        /// </summary>
        public int Id;
        /// <summary>
        /// 格式化URL
        /// </summary>
        /// <param name="name">页面名称/类型</param>
        /// <returns></returns>
        private webView.hashUrl getEnterprise(string name)
        {
            return new webView.hashUrl { Path = "/enterprise/" + name + ".html", Query = "examId=" + Id.toString() };
        }
        /// <summary>
        /// 考试编辑页面
        /// </summary>
        public webView.hashUrl Edit
        {
            get { return getEnterprise("examDescription"); }
        }
        /// <summary>
        /// 考试编辑页面
        /// </summary>
        public webView.hashUrl Copy
        {
            get { return new webView.hashUrl { Path = "/enterprise/examDescription.html", Query = "copyId=" + Id.toString() }; }
        }
        /// <summary>
        /// 参赛人员列表页面
        /// </summary>
        public webView.hashUrl UserList
        {
            get { return getEnterprise("examineeList"); }
        }
        /// <summary>
        /// 评审人员列表页面
        /// </summary>
        public webView.hashUrl ReviewUserList
        {
            get { return getEnterprise("examiner"); }
        }
        /// <summary>
        /// 试卷内容页面
        /// </summary>
        public webView.hashUrl PaperEdit
        {
            get { return getEnterprise("examPaper"); }
        }
        /// <summary>
        /// 答卷列表页面
        /// </summary>
        public webView.hashUrl PaperList
        {
            get { return getEnterprise("paperList"); }
        }
        /// <summary>
        /// 考试邀请
        /// </summary>
        public webView.hashUrl Invitation
        {
            get { return getEnterprise("invitation"); }
        }
        /// <summary>
        /// 考试邀请列表
        /// </summary>
        public webView.hashUrl InvitationList
        {
            get { return getEnterprise("invitationList"); }
        }
        /// <summary>
        /// 下载考试连接
        /// </summary>
        public string DownloadReportLink
        {
            get { return "/enterprise/exam/DownloadReportLink?examId=" + Id.toString(); }
        }
        
        /// <summary>
        /// 群发邮件页面
        /// </summary>
        public webView.hashUrl SendEmail
        {
            get { return getEnterprise("sendEmail"); }
        }
        /// <summary>
        /// 下载考试成绩报表的Zip
        /// </summary>
        public string DownloadReport
        {
            get { return "/enterprise/exam/DownloadReport?examId=" + this.Id.toString(); }
        }
        /// <summary>
        /// 下载考试用户的Zip
        /// </summary>
        public string DownloadRegister
        {
            get { return "/enterprise/exam/DownloadRegister?examId=" + this.Id.toString(); }
        }


        /// <summary>
        /// 格式化URL
        /// </summary>
        /// <param name="name">页面名称/类型</param>
        /// <returns></returns>
        private webView.hashUrl get(string name)
        {
            return new webView.hashUrl { Path = "/exam/" + name + ".html", Query = "examId=" + Id.toString() };
        }
        /// <summary>
        /// 格式化URL
        /// </summary>
        /// <param name="name">页面名称/类型</param>
        /// <returns></returns>
        private webView.hashUrl getHttps(string name)
        {
            return new webView.hashUrl { Path = diantou.dataModel.path.domain.Default.HttpsExamDomain + "exam/" + name + ".html", Query = "examId=" + Id.toString() };
        }
        /// <summary>
        /// 考试登录/首页
        /// </summary>
        public webView.hashUrl Index
        {
            get { return getHttps("index"); }
        }
        ///// <summary>
        ///// 测试考试注册(考生熟悉环境的测试赛)
        ///// </summary>
        //public webView.hashUrl Start
        //{
        //    get { return getHttps("register"); }
        //}
        /// <summary>
        /// 考试预览
        /// </summary>
        public webView.hashUrl Preview
        {
            get
            {
                webView.hashUrl url = get("index");
                url.Query += "&isPreview=1";
                return url;
            }
        }
        /// <summary>
        /// 企业考试说明
        /// </summary>
        public webView.hashUrl Description
        {
            get { return getHttps("description"); }
        }
        /// <summary>
        /// 用户注册(预先指定考生的考试)
        /// </summary>
        public webView.hashUrl Setting
        {
            get { return getHttps("setting"); }
        }
        /// <summary>
        /// 企业考试问题
        /// </summary>
        public webView.hashUrl Problem
        {
            get { return getHttps("problem"); }
        }
        /// <summary>
        /// 用户注册(完成答卷后发简历的考试)
        /// </summary>
        public webView.hashUrl Register
        {
            get { return getHttps("register"); }
        }
    }
}
